<div class="smis">
    <div class="message">
        <h1>Messages</h1>
        <div class="container-fluid">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#inbox" data-toggle="tab">Inbox</a></li>
                <li><a href="#outbox" data-toggle="tab">Outbox</a></li>
                <li><a href="#sent" data-toggle="tab">Sent</a></li>
                <li><a href="#compose" data-toggle="tab">Compose a new message</a></li>
            </ul>
            <div class="tab-content">
                <div id="inbox" class="tab-pane active">
                    <h4>Inbox</h4>
                    <ul>
                        <?php foreach($inboxmessages as $inbox) { ?>
                            <li><a href="#" messageid="<?= ?>"><?php echo $inbox['Text'];?></a></li>

                        <?php } ?>
                    </ul>

                </div>
                <div id="outbox" class="tab-pane">
                    <h4>Outbox</h4>

                </div>
                <div id="sent" class="tab-pane">
                    <h4>Sent</h4>
                    <ul>
                        <?php foreach($sentmessages as $sent) { ?>
                            <li><?php echo $sent['Text'];?></li>

                        <?php } ?>
                    </ul>
                </div>
                <div id="compose" class="tab-pane">
                    <h4>Compose a new message</h4>
                    <form id="formSend" action="<?= $base_url?>smis/message/send" method="post" accept-charset="utf-8">
                        <label for="receive">Message Receiver ( separated by semicolon ';' ) : </label>
                        <input type="text" name="receive" id="receive"/>
                        <label for="title">Message Title: </label>
                        <input type="text" name="title" id="title"/>
                        <label for="message">Message Content: </label>
                        <textarea name="message" id="message"></textarea>
                    </form>
                    <button id="btnSend" class="button">Send</button>
                    <button id="btnSave" class="button">Save to Outbox</button>
                    <button id="btnCancel" class="button">Cancel</button>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $('#btnSend').on('click', function(event){
        $('#formSend').submit();
    });

</script>